use :: libc;
extern "C" {
    fn tolower(_: i32) -> i32;
    fn strcmp(_: *const i8, _: *const i8) -> i32;
}
#[no_mangle]
pub extern "C" fn string_equal(
    mut string1: *mut libc::c_void,
    mut string2: *mut libc::c_void,
) -> i32 {
    return ((unsafe { strcmp(string1 as *mut i8, string2 as *mut i8) }) == 0 as i32) as i32;
}
#[no_mangle]
pub extern "C" fn string_compare(
    mut string1: *mut libc::c_void,
    mut string2: *mut libc::c_void,
) -> i32 {
    let mut result: i32 = 0;
    result = unsafe { strcmp(string1 as *mut i8, string2 as *mut i8) };
    if result < 0 as i32 {
        return -(1 as i32);
    } else if result > 0 as i32 {
        return 1 as i32;
    } else {
        return 0 as i32;
    };
}
#[no_mangle]
pub extern "C" fn string_nocase_equal(
    mut string1: *mut libc::c_void,
    mut string2: *mut libc::c_void,
) -> i32 {
    return (string_nocase_compare(
        string1 as *mut i8 as *mut libc::c_void,
        string2 as *mut i8 as *mut libc::c_void,
    ) == 0 as i32) as i32;
}
#[no_mangle]
pub extern "C" fn string_nocase_compare(
    mut string1: *mut libc::c_void,
    mut string2: *mut libc::c_void,
) -> i32 {
    let mut p1: *mut i8 = 0 as *mut i8;
    let mut p2: *mut i8 = 0 as *mut i8;
    let mut c1: i32 = 0;
    let mut c2: i32 = 0;
    p1 = string1 as *mut i8;
    p2 = string2 as *mut i8;
    loop {
        c1 = unsafe { tolower(*p1 as i32) };
        c2 = unsafe { tolower(*p2 as i32) };
        if c1 != c2 {
            if c1 < c2 {
                return -(1 as i32);
            } else {
                return 1 as i32;
            }
        }
        if c1 == '\0' as i32 {
            break;
        }
        p1 = unsafe { p1.offset(1) };
        p1;
        p2 = unsafe { p2.offset(1) };
        p2;
    }
    return 0 as i32;
}
